// 换汇接口
import { postRequest, getRequest } from "@/utils/request";
import { getRequest1, postRequest1 } from "@/utils/request1";

//获取我的挂单记录
export const getEntRecordsApi = (param) => {
  return getRequest("/api/exchange/ent/records", param);
};
// 获取币种列表
export const getCurrencyApi = (param) => {
  return getRequest("/api/exchange/currency", param);
};

// 设置挂单（开启/暂停）
export const setEntApi = (param) => {
  return getRequest("/api/exchange/ent/set", param);
};
// 设置挂单（开启/暂停）
export const entPublishApi = (param) => {
  return postRequest("/api/exchange/ent/publish", param);
};
// 删除挂单
export const entDeleteApi = (param) => {
  return postRequest("/api/exchange/ent/delete", param);
};
//挂单列表（下单用）
export const getEntMarketApi = (param) => {
  return getRequest("/api/exchange/ent/market", param);
};
//挂单详情（下单前查询）
export const getEntDetailApi = (param) => {
  return getRequest("/api/exchange/ent/detail", param);
};
//下单
export const orderStartApi = (param) => {
  return postRequest("/api/exchange/order/start", param);
};

// 汇率接口
export const exchangePriceApi = (param) => {
  return getRequest("/api/exchange/price", param);
};
//订单记录（下单记录）
export const orderRecordsApi = (param, type) => {
  return getRequest("/api/exchange/order/records", param, type);
};
//订单详情
export const orderDetailApi = (param) => {
  return getRequest("/api/exchange/order/detail", param);
};
// 取消订单
export const orderCancelApi = (param) => {
  return postRequest("/api/exchange/order/cancel", param);
};
// 订单确认
export const orderConfirmApi = (param) => {
  return postRequest("/api/exchange/order/confirm", param);
};

// 重新设置价格
export const resetPriceApi = (param) => {
  return postRequest("/api/exchange/order/reset", param);
};

// 已开通换汇商户列表
export const openExMerchantsApi = (param) => {
  return postRequest("/api/exchange/merchants", param);
};

// 换汇订单列表
export const orderListApi = (param) => {
  return getRequest("/api/exchange/v2/order/list", param);
};

// 换汇新增
export const exchangeStartApi = (param) => {
  return postRequest("/api/exchange/v2/start", param);
};

// ==================== 加密 ========================

// 获取币种列表
export const getCurrencyNewApi = (param) => {
  return getRequest1("/api/v2/exchange/currency", param);
};

// 汇率接口
export const exchangePriceNewApi = (param) => {
  return getRequest1("/api/v2/exchange/price", param);
};

// 换汇新增
export const exchangeStartNewApi = (param) => {
  return postRequest1("/api/v2/exchange/start", param);
};

// 换汇订单列表
export const orderListNewApi = (param) => {
  return getRequest1("/api/v2/exchange/order/list", param);
};
